import {post,fetch,del} from './http'

// 首页轮播
export const swiperImg = function (data) {
    return new Promise((resolve, reject) => {
        post('/rubbish-server/rubbish/swiper', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}

// 分页接口
export const getRubbishList = function (data) {
    return new Promise((resolve, reject) => {
        post('/rubbish-server/rubbish/query', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 修改
export const rubbishUpdate = function (data) {
    return new Promise((resolve, reject) => {
        post('/rubbish-server/rubbish/update', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 创建
export const rubbishCreate = function (data) {
    return new Promise((resolve, reject) => {
        post('/rubbish-server/rubbish/create', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 批量删除
export const delRubbishBatch = function (data) {
    return new Promise((resolve, reject) => {
        del('/rubbish-server/rubbish/delete/list', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 根据获取
export const getRubbishById = function (data) {
    return new Promise((resolve, reject) => {
        fetch('/rubbish-server/rubbish/'+ data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 删除
export const delRubbishById = function (data) {
    return new Promise((resolve, reject) => {
        del('/rubbish-server/rubbish/delete/'+ data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}

// 